#!/usr/bin/node

const Dog = require('./02-dog.js');
var taidi = new Dog('taidi', 4);
var qxc = new Dog('qxc', 9);

taidi.on('bark', onBark);
qxc.on('bark', onBark);

function onBark() {
  console.log('%s barked! energy: %s', this.name(), this.energy());
}

